function fun_discrete_chai;
% ???????[?????]
% discrete Chuaps circuit
% Author's email:zjliu2001@163.com
% reference:
% ?????????????????????
% ?????,2001
% 
% downloaded from http://luobo.yculblog.com/archive.56999.p2.html
%
dt=0.04;
c1=1/9;
c2=1;
L=1/7;
G=0.7;
N=10000;
a0=0.8;a1=0.1;
MT=[1-dt*G/c1,dt*G/c1,0;dt*G/c2,(1-dt*G/c2),dt/c2;0,-dt/L,1];

UVI=zeros(3,N);
UVI(:,1)=[0.1;0.1;0.1];
for k=1:N-1;
   Bd=[-dt/c1*a0*UVI(1,k)*(a1^2*UVI(1,k)^2/3-1);0;0];
   UVI(:,k+1)=MT*UVI(:,k)+Bd;
end
subplot(131)
plot(UVI(3,1:end),UVI(2,1:end));
xlabel('I (A)');ylabel('V (V)');
subplot(132)
plot(UVI(3,1:end),UVI(1,1:end));
xlabel('I (A)');ylabel('U (V)');
subplot(133)
plot(UVI(2,1:end),UVI(1,1:end));
xlabel('V (V)');ylabel('U (V)');
figure;
plot3(UVI(3,1:end),UVI(2,1:end),UVI(1,1:end))
xlabel('I (V)');ylabel('V (V)');zlabel('U (V)');